package org.misty.redis.web.config;

import org.misty.redis.bloomfilter.BloomFilter;
import org.misty.redis.cache.RedisCache;
import org.misty.redis.locker.RedisLocker;
import org.misty.redis.web.User;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Misty on 2020-06-01
 */
@Configuration
public class CacheConfigurer {
    @Bean
    public RedisCache<User> redisCache(RedisLocker locker, @Qualifier("userFilter") BloomFilter filter) {
        return new RedisCache<>("lock:user", locker, filter);
    }
}
